<?php

namespace common\models\db\tables;

use Yii;

/**
 * This is the model class for table "{{%permissions}}".
 *
 * @property int $id
 * @property int|null $pid
 * @property string $path
 * @property int $created_at
 * @property int $updated_at
 */
class Permissions extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%permissions}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['pid', 'path', 'created_at', 'updated_at'], 'trim'],
            [['pid', 'created_at', 'updated_at'], 'integer'],
            [['path', 'created_at', 'updated_at'], 'required'],
            [['path'], 'string', 'max' => 180],
            [['pid'], 'default', 'value' => null],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app', 'ID'),
            'pid' => Yii::t('app', 'Pid'),
            'path' => Yii::t('app', 'Path'),
            'created_at' => Yii::t('app', 'Created At'),
            'updated_at' => Yii::t('app', 'Updated At'),
        ];
    }
}
